<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    =={{msg}}
    <hr />
   <input type="text" v-model.number="val">
   <select v-model="val2">
    <option value="+">+</option>
    <option value="-">-</option>
    <option value="*">*</option>
    <option value="/">/</option>

   </select>
   <input type="text" v-model.number="val1">={{num}}
  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.min.js"></script>
  <script>
    var vm = new Vue({
      el: "#app",
      data: {
        msg: 'hello  vue',
        val:2,
        val1:2,
        val2:'+',
        
      },
      computed:{
        num(){
          if(this.val2 == '+'){
           return this.num = this.val + this.val1
          }
          if(this.val2 == '-'){
           return this.num = this.val - this.val1
          }
          if(this.val2 == '*'){
           return this.num = this.val * this.val1
          }
          if(this.val2 == '/'){
           return this.num = this.val / this.val1
          }
        }
      }
    })

    // console.log(vm, 2222);
  </script>
</body>

</html>